package com.tencet.servlet;

import com.tencet.service.Impl.UserServiceImpl;
import com.tencet.service.UserService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: aiming    @date: 2022/7/21 15:38
 * @description:
 */
@WebServlet("/registered")
public class RegistServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //接收参数
        String phoneNum = req.getParameter("phoneNum");
        String password = req.getParameter("password");

        //调用Service
        UserService userService = new UserServiceImpl();
        boolean result = userService.registered(phoneNum,password);

        //写回到页面
        resp.getWriter().write(result + "");
    }
}

